﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.EndModelingEntityLevel.CUiEMEndModelingEntityLevelForm
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using C1.Win.C1FlexGrid;
using C1.Win.C1FlexGrid.Util.BaseControls;
using EngineeringInternalExtension;
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using Tecnomatix.Engineering;
using Tecnomatix.Engineering.PrivateImplementationDetails;
using Tecnomatix.Engineering.Ui;
using Tecnomatix.Engineering.Ui48;


namespace DnProcessSimulateCommands.EndModelingEntityLevel;

internal class CUiEMEndModelingEntityLevelForm : TxForm, IUiEMEndModelingForm
{
  private CApEMEndModelingEntityLevelApp m_app;
  private string m_entityTypeName = string.Empty;
  private string m_pMITypeName = string.Empty;
  private const int TYPE_COL = 2;
  private const int CHECK_ALL_BUTTON = 0;
  private const int UNCHECK_ALL_BUTTON = 2;
  private IContainer components;
  private Label m_referencesLoseWarningLabel;
  private TxFlexGrid m_preserveEntitiesTable;
  private Label m_entitiesToPreserveLabel;
  private Panel m_buttonsPanel;
  private Button m_buttonCancel;
  private Button m_buttonOK;
  private ToolTip m_toolTip;
  private GroupBox m_preservedGroupBox;
  private GroupBox m_loadingModeGroupBox;
  private CheckBox m_reloadWithPMICheckBox;
  private Panel m_reloadRepresentationPanel;
  private RadioButton m_radioButtonReloadInDetailedRep;
  private RadioButton m_radioButtonReloadInUnitedRep;
  private ImageList m_imageList;
  private ContextMenu m_checkAllOptionsContextMenu;
  private MenuItem m_checkAllMenuItem;
  private MenuItem m_checkAllEntitiesMenuItem;
  private MenuItem m_checkAllPMIsMenuItem;
  private ToolBarButton m_checkAllToolBarButton;
  private ToolBarButton m_seperatorToolBarButton;
  private ToolBarButton m_uncheckAllToolBarButton;
  private Label m_seperatorLabel;
  private TxToolBar m_checkPreservedToolBar;

  private string EntityTypeName
  {
    get
    {
      if (this.m_entityTypeName.Equals(string.Empty))
        this.m_entityTypeName = EndModelingEntityLevelStringTable.ENTITY_TYPE_NAME;
      return this.m_entityTypeName;
    }
  }

  private string PMITypeName
  {
    get
    {
      if (this.m_pMITypeName.Equals(string.Empty))
        this.m_pMITypeName = EndModelingEntityLevelStringTable.PMI_TYPE_NAME;
      return this.m_pMITypeName;
    }
  }

  public CUiEMEndModelingEntityLevelForm()
  {
    this.InitializeComponent();
    this.RegisterToUnloadDocumentEvent();
  }

  public bool EndModeling(CApEMEndModelingEntityLevelApp app)
  {
    bool flag = false;
    this.m_app = app;
    this.FillFormData();
    if (((Form) this).ShowDialog() == DialogResult.OK)
      flag = true;
    return flag;
  }

  private void FillFormData()
  {
    this.InitDefaultRepresentationLevel();
    this.InitDefaultPMILevel();
    this.FillNonPreservedReferencedObjects();
  }

  private void InitDefaultPMILevel()
  {
    this.m_reloadWithPMICheckBox.Checked = this.m_app.IsNonModelingPMILoaded;
  }

  private void InitDefaultRepresentationLevel()
  {
    this.m_radioButtonReloadInUnitedRep.Checked = this.m_app.Component.NonModelingRepresentationLevel == 4;
    this.m_radioButtonReloadInDetailedRep.Checked = !this.m_radioButtonReloadInUnitedRep.Checked;
  }

  private void FillNonPreservedReferencedObjects()
  {
    this.ClearReferencedEntities();
    if (this.m_app.RefrencedEntities.Count <= 0)
      return;
    this.InitReferencedObjectsTable(this.m_app.RefrencedEntities);
    this.EnableEntitiesToPreserveTableSelectionButtons();
  }

  public void ClearReferencedEntities()
  {
    RowCollection rows = ((C1FlexGridBase) this.m_preserveEntitiesTable).Rows;
    while (((RowColCollection) rows).Count > 1)
      rows.Remove(((RowColCollection) rows).Count - 1);
  }

  private void InitReferencedObjectsTable(
    Dictionary<ITxDetailedRepresentation, bool> referencedObjects)
  {
    foreach (ITxDetailedRepresentation key in referencedObjects.Keys)
    {
      string typeNameForTable = this.GetEntityTypeNameForTable(key);
      ((RowCol) ((C1FlexGridBase) this.m_preserveEntitiesTable).AddItem(new object[3]
      {
        (object) false,
        (object) ((ITxObject) key).Name,
        (object) typeNameForTable
      })).UserData = (object) key;
    }
    ((C1FlexGridBase) this.m_preserveEntitiesTable).Sort((SortFlags) 1, 2);
  }

  private string GetEntityTypeNameForTable(ITxDetailedRepresentation entity)
  {
    string typeNameForTable = string.Empty;
    if (entity == null)
    {
      TxApplication.LogWriter.WriteErrorLine("entity cannot be null");
    }
    else
    {
      typeNameForTable = this.EntityTypeName;
      if (TxObjectEx.HasPMIType((ITxObject) entity))
        typeNameForTable = this.PMITypeName;
    }
    return typeNameForTable;
  }

  private void EnableEntitiesToPreserveTableSelectionButtons()
  {
    if (this.m_preserveEntitiesTable == null)
    {
      this.m_checkAllToolBarButton.Enabled = false;
      this.m_uncheckAllToolBarButton.Enabled = false;
    }
    else
    {
      RowCollection rows = ((C1FlexGridBase) this.m_preserveEntitiesTable).Rows;
      this.UpdateCheckAsPreserveButtonsEnableState(this.CollectPReservedReferencesData(rows), rows);
    }
  }

  private void UpdateCheckAsPreserveButtonsEnableState(
    CUiEMEndModelingEntityLevelForm.SApEMEndModelingPreserveTableSummary summary,
    RowCollection rows)
  {
    if (summary.numCheckedPMI == 0 && summary.numCheckedEntities == 0)
    {
      this.m_checkAllToolBarButton.Enabled = true;
      this.m_checkAllEntitiesMenuItem.Enabled = summary.numEntities > 0;
      this.m_checkAllPMIsMenuItem.Enabled = summary.numPMI > 0;
      this.m_uncheckAllToolBarButton.Enabled = false;
    }
    else
    {
      this.m_uncheckAllToolBarButton.Enabled = true;
      this.m_checkAllToolBarButton.Enabled = summary.numCheckedPMI + summary.numCheckedEntities != ((RowColCollection) rows).Count - 1;
      if (!this.m_checkAllToolBarButton.Enabled)
        return;
      this.m_checkAllEntitiesMenuItem.Enabled = summary.numCheckedEntities < summary.numEntities;
      if (summary.numCheckedPMI < summary.numPMI)
        this.m_checkAllPMIsMenuItem.Enabled = true;
      else
        this.m_checkAllPMIsMenuItem.Enabled = false;
    }
  }

  private CUiEMEndModelingEntityLevelForm.SApEMEndModelingPreserveTableSummary CollectPReservedReferencesData(
    RowCollection rows)
  {
    CUiEMEndModelingEntityLevelForm.SApEMEndModelingPreserveTableSummary preserveTableSummary;
    preserveTableSummary.numCheckedEntities = 0;
    preserveTableSummary.numEntities = 0;
    preserveTableSummary.numCheckedPMI = 0;
    preserveTableSummary.numPMI = 0;
    foreach (Row row in (IEnumerable) rows)
    {
      if (((RowCol) row).UserData is ITxDetailedRepresentation)
      {
        string str = row[2] as string;
        if (this.IsNonPMIEntity(row))
        {
          if ((bool) row[0])
            ++preserveTableSummary.numCheckedEntities;
          ++preserveTableSummary.numEntities;
        }
        if (this.IsPMIEntity(row))
        {
          if ((bool) row[0])
            ++preserveTableSummary.numCheckedPMI;
          ++preserveTableSummary.numPMI;
        }
      }
    }
    return preserveTableSummary;
  }

  private bool IsNonPMIEntity(Row row)
  {
    string str = row[2] as string;
    bool flag = false;
    if (this.EntityTypeName.Equals(str))
      flag = true;
    return flag;
  }

  private bool IsPMIEntity(Row row)
  {
    string str = row[2] as string;
    bool flag = false;
    if (this.PMITypeName.Equals(str))
      flag = true;
    return flag;
  }

  private void SetAllReferencesPreservedState(
    CUiEMEndModelingEntityLevelForm.CEEMEndModelingEntityType preserveType)
  {
    bool flag1 = preserveType == CUiEMEndModelingEntityLevelForm.CEEMEndModelingEntityType.PMI || preserveType == CUiEMEndModelingEntityLevelForm.CEEMEndModelingEntityType.All;
    bool flag2 = preserveType == CUiEMEndModelingEntityLevelForm.CEEMEndModelingEntityType.NonPMI || preserveType == CUiEMEndModelingEntityLevelForm.CEEMEndModelingEntityType.All;
    bool flag3 = preserveType == CUiEMEndModelingEntityLevelForm.CEEMEndModelingEntityType.None;
    foreach (Row row in (IEnumerable) ((C1FlexGridBase) this.m_preserveEntitiesTable).Rows)
    {
      if (((RowCol) row).UserData is ITxDetailedRepresentation)
      {
        if (flag1 && this.IsPMIEntity(row))
          row[0] = (object) true;
        else if (flag2 && this.IsNonPMIEntity(row))
          row[0] = (object) true;
        else if (flag3)
          row[0] = (object) false;
      }
    }
  }

  private void SetEntityPreserveState(
    CUiEMEndModelingEntityLevelForm.CEEMEndModelingEntityType preserveType)
  {
    ((C1FlexGridBase) this.m_preserveEntitiesTable).CellChanged -= new RowColEventHandler(this.m_preserveEntitiesTable_CellChanged);
    this.SetAllReferencesPreservedState(preserveType);
    ((C1FlexGridBase) this.m_preserveEntitiesTable).CellChanged += new RowColEventHandler(this.m_preserveEntitiesTable_CellChanged);
  }

  private void m_checkAllMenuItem_Click(object sender, EventArgs e) => this.CheckAll();

  private void m_checkAllEntitiesMenuItem_Click(object sender, EventArgs e)
  {
    this.CheckAllNonPMIs();
  }

  private void m_checkAllPMIsMenuItem_Click(object sender, EventArgs e) => this.CheckAllPMIs();

  private void CheckAll()
  {
    this.SetEntityPreserveState(CUiEMEndModelingEntityLevelForm.CEEMEndModelingEntityType.All);
    this.EnableEntitiesToPreserveTableSelectionButtons();
  }

  private void CheckAllPMIs()
  {
    this.SetEntityPreserveState(CUiEMEndModelingEntityLevelForm.CEEMEndModelingEntityType.PMI);
    this.EnableEntitiesToPreserveTableSelectionButtons();
  }

  private void CheckAllNonPMIs()
  {
    this.SetEntityPreserveState(CUiEMEndModelingEntityLevelForm.CEEMEndModelingEntityType.NonPMI);
    this.EnableEntitiesToPreserveTableSelectionButtons();
  }

  private void UncheckAll()
  {
    this.SetEntityPreserveState(CUiEMEndModelingEntityLevelForm.CEEMEndModelingEntityType.None);
    this.EnableEntitiesToPreserveTableSelectionButtons();
  }

  private void m_checkPreservedToolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
  {
    switch (((ToolBar) this.m_checkPreservedToolBar).Buttons.IndexOf(e.Button))
    {
      case 0:
        this.CheckAll();
        break;
      case 2:
        this.UncheckAll();
        break;
    }
  }

  private void m_preserveEntitiesTable_CellChanged(object sender, RowColEventArgs e)
  {
    if (e.Col != 0)
      return;
    this.EnableEntitiesToPreserveTableSelectionButtons();
  }

  private void m_buttonOK_Click(object sender, EventArgs e)
  {
    this.m_app.ReloadInDetailRepresentation = this.m_radioButtonReloadInDetailedRep.Checked;
    this.m_app.ReloadPMIs = this.m_reloadWithPMICheckBox.Checked;
    foreach (Row row in (IEnumerable) ((C1FlexGridBase) this.m_preserveEntitiesTable).Rows)
    {
      if (((RowCol) row).UserData is ITxDetailedRepresentation userData)
        this.m_app.RefrencedEntities[userData] = (bool) row[0];
    }
    ((Form) this).Close();
  }

  private void m_buttonCancel_Click(object sender, EventArgs e) => ((Form) this).Close();

  private void CUiEMEndModelingEntityLevelForm_FormClosed(object sender, FormClosedEventArgs e)
  {
    this.UnRegisterFromUnloadDocumentEvent();
  }

  private void RegisterToUnloadDocumentEvent()
  {
    TxApplication.ActiveDocument.Unloading += new TxDocument_UnloadingEventHandler(this.OnUnloadDocument);
  }

  private void UnRegisterFromUnloadDocumentEvent()
  {
    TxApplication.ActiveDocument.Unloading -= new TxDocument_UnloadingEventHandler(this.OnUnloadDocument);
  }

  private void OnUnloadDocument(object sender, TxDocument_UnloadingEventArgs args)
  {
    ((Form) this).Close();
  }

  protected virtual void Dispose(bool disposing)
  {
    if (disposing && this.components != null)
      this.components.Dispose();
    base.Dispose(disposing);
  }

  private void InitializeComponent()
  {
    this.components = (IContainer) new Container();
    ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (CUiEMEndModelingEntityLevelForm));
    this.m_referencesLoseWarningLabel = new Label();
    this.m_preservedGroupBox = new GroupBox();
    this.m_checkPreservedToolBar = new TxToolBar();
    this.m_checkAllToolBarButton = new ToolBarButton();
    this.m_checkAllOptionsContextMenu = new ContextMenu();
    this.m_checkAllMenuItem = new MenuItem();
    this.m_checkAllEntitiesMenuItem = new MenuItem();
    this.m_checkAllPMIsMenuItem = new MenuItem();
    this.m_seperatorToolBarButton = new ToolBarButton();
    this.m_uncheckAllToolBarButton = new ToolBarButton();
    this.m_imageList = new ImageList(this.components);
    this.m_preserveEntitiesTable = new TxFlexGrid();
    this.m_entitiesToPreserveLabel = new Label();
    this.m_buttonsPanel = new Panel();
    this.m_buttonCancel = new Button();
    this.m_buttonOK = new Button();
    this.m_toolTip = new ToolTip(this.components);
    this.m_loadingModeGroupBox = new GroupBox();
    this.m_seperatorLabel = new Label();
    this.m_reloadWithPMICheckBox = new CheckBox();
    this.m_reloadRepresentationPanel = new Panel();
    this.m_radioButtonReloadInDetailedRep = new RadioButton();
    this.m_radioButtonReloadInUnitedRep = new RadioButton();
    this.m_preservedGroupBox.SuspendLayout();
    ((ISupportInitialize) this.m_preserveEntitiesTable).BeginInit();
    this.m_buttonsPanel.SuspendLayout();
    this.m_loadingModeGroupBox.SuspendLayout();
    this.m_reloadRepresentationPanel.SuspendLayout();
    ((Control) this).SuspendLayout();
    componentResourceManager.ApplyResources((object) this.m_referencesLoseWarningLabel, "m_referencesLoseWarningLabel");
    this.m_referencesLoseWarningLabel.Name = "m_referencesLoseWarningLabel";
    this.m_preservedGroupBox.BackColor = SystemColors.Control;
    this.m_preservedGroupBox.Controls.Add((Control) this.m_checkPreservedToolBar);
    this.m_preservedGroupBox.Controls.Add((Control) this.m_preserveEntitiesTable);
    this.m_preservedGroupBox.Controls.Add((Control) this.m_entitiesToPreserveLabel);
    componentResourceManager.ApplyResources((object) this.m_preservedGroupBox, "m_preservedGroupBox");
    this.m_preservedGroupBox.Name = "m_preservedGroupBox";
    this.m_preservedGroupBox.TabStop = false;
    componentResourceManager.ApplyResources((object) this.m_checkPreservedToolBar, "m_checkPreservedToolBar");
    ((ToolBar) this.m_checkPreservedToolBar).Buttons.AddRange(new ToolBarButton[3]
    {
      this.m_checkAllToolBarButton,
      this.m_seperatorToolBarButton,
      this.m_uncheckAllToolBarButton
    });
    ((ToolBar) this.m_checkPreservedToolBar).Divider = false;
    ((ToolBar) this.m_checkPreservedToolBar).ImageList = this.m_imageList;
    ((Control) this.m_checkPreservedToolBar).Name = "m_checkPreservedToolBar";
    ((ToolBar) this.m_checkPreservedToolBar).ButtonClick += new ToolBarButtonClickEventHandler(this.m_checkPreservedToolBar_ButtonClick);
    this.m_checkAllToolBarButton.DropDownMenu = (Menu) this.m_checkAllOptionsContextMenu;
    componentResourceManager.ApplyResources((object) this.m_checkAllToolBarButton, "m_checkAllToolBarButton");
    this.m_checkAllToolBarButton.Name = "m_checkAllToolBarButton";
    this.m_checkAllToolBarButton.Style = ToolBarButtonStyle.DropDownButton;
    this.m_checkAllOptionsContextMenu.MenuItems.AddRange(new MenuItem[3]
    {
      this.m_checkAllMenuItem,
      this.m_checkAllEntitiesMenuItem,
      this.m_checkAllPMIsMenuItem
    });
    this.m_checkAllMenuItem.Index = 0;
    componentResourceManager.ApplyResources((object) this.m_checkAllMenuItem, "m_checkAllMenuItem");
    this.m_checkAllMenuItem.Click += new EventHandler(this.m_checkAllMenuItem_Click);
    this.m_checkAllEntitiesMenuItem.Index = 1;
    componentResourceManager.ApplyResources((object) this.m_checkAllEntitiesMenuItem, "m_checkAllEntitiesMenuItem");
    this.m_checkAllEntitiesMenuItem.Click += new EventHandler(this.m_checkAllEntitiesMenuItem_Click);
    this.m_checkAllPMIsMenuItem.Index = 2;
    componentResourceManager.ApplyResources((object) this.m_checkAllPMIsMenuItem, "m_checkAllPMIsMenuItem");
    this.m_checkAllPMIsMenuItem.Click += new EventHandler(this.m_checkAllPMIsMenuItem_Click);
    this.m_seperatorToolBarButton.Name = "m_seperatorToolBarButton";
    this.m_seperatorToolBarButton.Style = ToolBarButtonStyle.Separator;
    componentResourceManager.ApplyResources((object) this.m_uncheckAllToolBarButton, "m_uncheckAllToolBarButton");
    this.m_uncheckAllToolBarButton.Name = "m_uncheckAllToolBarButton";
    this.m_imageList.ImageStream = (ImageListStreamer) componentResourceManager.GetObject("m_imageList.ImageStream");
    this.m_imageList.TransparentColor = Color.Transparent;
    this.m_imageList.Images.SetKeyName(0, "check all.bmp");
    this.m_imageList.Images.SetKeyName(1, "uncheck all.bmp");
    ((C1FlexGridBase) this.m_preserveEntitiesTable).AllowDragging = (AllowDraggingEnum) 0;
    ((C1FlexGridBase) this.m_preserveEntitiesTable).AllowSorting = (AllowSortingEnum) 0;
    componentResourceManager.ApplyResources((object) this.m_preserveEntitiesTable, "m_preserveEntitiesTable");
    ((C1FlexGridBase) this.m_preserveEntitiesTable).EmptyAsNull = false;
    ((C1FlexGridBase) this.m_preserveEntitiesTable).ExtendLastCol = true;
    ((C1FlexGridBase) this.m_preserveEntitiesTable).FocusRect = (FocusRectEnum) 0;
    ((C1FlexGridBase) this.m_preserveEntitiesTable).HighLight = (HighLightEnum) 2;
    ((Control) this.m_preserveEntitiesTable).Name = "m_preserveEntitiesTable";
    ((RowColCollection) ((C1FlexGridBase) this.m_preserveEntitiesTable).Rows).Count = 8;
    ((RowColCollection) ((C1FlexGridBase) this.m_preserveEntitiesTable).Rows).DefaultSize = 19;
    ((ScrollableControl) this.m_preserveEntitiesTable).ScrollBars = ScrollBars.Vertical;
    ((C1FlexGridBase) this.m_preserveEntitiesTable).SelectionMode = (SelectionModeEnum) 3;
    ((C1FlexGridBase) this.m_preserveEntitiesTable).StyleInfo = componentResourceManager.GetString("m_preserveEntitiesTable.StyleInfo");
    ((C1FlexGridBase) this.m_preserveEntitiesTable).CellChanged += new RowColEventHandler(this.m_preserveEntitiesTable_CellChanged);
    componentResourceManager.ApplyResources((object) this.m_entitiesToPreserveLabel, "m_entitiesToPreserveLabel");
    this.m_entitiesToPreserveLabel.Name = "m_entitiesToPreserveLabel";
    this.m_buttonsPanel.BackColor = SystemColors.Control;
    this.m_buttonsPanel.Controls.Add((Control) this.m_buttonCancel);
    this.m_buttonsPanel.Controls.Add((Control) this.m_buttonOK);
    componentResourceManager.ApplyResources((object) this.m_buttonsPanel, "m_buttonsPanel");
    this.m_buttonsPanel.Name = "m_buttonsPanel";
    this.m_buttonCancel.DialogResult = DialogResult.Cancel;
    componentResourceManager.ApplyResources((object) this.m_buttonCancel, "m_buttonCancel");
    this.m_buttonCancel.Name = "m_buttonCancel";
    this.m_buttonCancel.UseVisualStyleBackColor = true;
    this.m_buttonCancel.Click += new EventHandler(this.m_buttonCancel_Click);
    this.m_buttonOK.DialogResult = DialogResult.OK;
    componentResourceManager.ApplyResources((object) this.m_buttonOK, "m_buttonOK");
    this.m_buttonOK.Name = "m_buttonOK";
    this.m_buttonOK.UseVisualStyleBackColor = true;
    this.m_buttonOK.Click += new EventHandler(this.m_buttonOK_Click);
    this.m_loadingModeGroupBox.BackColor = SystemColors.Control;
    this.m_loadingModeGroupBox.Controls.Add((Control) this.m_seperatorLabel);
    this.m_loadingModeGroupBox.Controls.Add((Control) this.m_reloadWithPMICheckBox);
    this.m_loadingModeGroupBox.Controls.Add((Control) this.m_reloadRepresentationPanel);
    componentResourceManager.ApplyResources((object) this.m_loadingModeGroupBox, "m_loadingModeGroupBox");
    this.m_loadingModeGroupBox.Name = "m_loadingModeGroupBox";
    this.m_loadingModeGroupBox.TabStop = false;
    this.m_seperatorLabel.BorderStyle = BorderStyle.Fixed3D;
    componentResourceManager.ApplyResources((object) this.m_seperatorLabel, "m_seperatorLabel");
    this.m_seperatorLabel.Name = "m_seperatorLabel";
    componentResourceManager.ApplyResources((object) this.m_reloadWithPMICheckBox, "m_reloadWithPMICheckBox");
    this.m_reloadWithPMICheckBox.Name = "m_reloadWithPMICheckBox";
    this.m_reloadWithPMICheckBox.UseVisualStyleBackColor = true;
    this.m_reloadRepresentationPanel.Controls.Add((Control) this.m_radioButtonReloadInDetailedRep);
    this.m_reloadRepresentationPanel.Controls.Add((Control) this.m_radioButtonReloadInUnitedRep);
    componentResourceManager.ApplyResources((object) this.m_reloadRepresentationPanel, "m_reloadRepresentationPanel");
    this.m_reloadRepresentationPanel.Name = "m_reloadRepresentationPanel";
    componentResourceManager.ApplyResources((object) this.m_radioButtonReloadInDetailedRep, "m_radioButtonReloadInDetailedRep");
    this.m_radioButtonReloadInDetailedRep.Name = "m_radioButtonReloadInDetailedRep";
    this.m_radioButtonReloadInDetailedRep.UseVisualStyleBackColor = true;
    componentResourceManager.ApplyResources((object) this.m_radioButtonReloadInUnitedRep, "m_radioButtonReloadInUnitedRep");
    this.m_radioButtonReloadInUnitedRep.Checked = true;
    this.m_radioButtonReloadInUnitedRep.Name = "m_radioButtonReloadInUnitedRep";
    this.m_radioButtonReloadInUnitedRep.TabStop = true;
    this.m_radioButtonReloadInUnitedRep.UseVisualStyleBackColor = true;
    ((Form) this).AcceptButton = (IButtonControl) this.m_buttonOK;
    componentResourceManager.ApplyResources((object) this, "$this");
    ((ContainerControl) this).AutoScaleMode = AutoScaleMode.Font;
    ((Form) this).CancelButton = (IButtonControl) this.m_buttonCancel;
    ((Control) this).Controls.Add((Control) this.m_loadingModeGroupBox);
    ((Control) this).Controls.Add((Control) this.m_preservedGroupBox);
    ((Control) this).Controls.Add((Control) this.m_buttonsPanel);
    ((Control) this).Controls.Add((Control) this.m_referencesLoseWarningLabel);
    ((Form) this).FormBorderStyle = FormBorderStyle.FixedDialog;
    ((Form) this).MaximizeBox = false;
    ((Form) this).MinimizeBox = false;
    ((Control) this).Name = nameof (CUiEMEndModelingEntityLevelForm);
    this.SemiModal = false;
    ((Form) this).ShowIcon = false;
    ((Form) this).FormClosed += new FormClosedEventHandler(this.CUiEMEndModelingEntityLevelForm_FormClosed);
    this.m_preservedGroupBox.ResumeLayout(false);
    this.m_preservedGroupBox.PerformLayout();
    ((ISupportInitialize) this.m_preserveEntitiesTable).EndInit();
    this.m_buttonsPanel.ResumeLayout(false);
    this.m_loadingModeGroupBox.ResumeLayout(false);
    this.m_loadingModeGroupBox.PerformLayout();
    this.m_reloadRepresentationPanel.ResumeLayout(false);
    this.m_reloadRepresentationPanel.PerformLayout();
    ((Control) this).ResumeLayout(false);
  }

  public struct SApEMEndModelingPreserveTableSummary
  {
    public int numCheckedPMI;
    public int numPMI;
    public int numCheckedEntities;
    public int numEntities;
  }

  private enum CEEMEndModelingEntityType
  {
    None,
    All,
    PMI,
    NonPMI,
  }
}
